import { Component,ViewChild } from '@angular/core';
import { IonicPage, NavController, NavParams,Slides} from 'ionic-angular';

/**
 * Generated class for the SlidePhotoPage page.
 *
 * See http://ionicframework.com/docs/components/#navigation for more info
 * on Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'p-slide-photo',
  templateUrl: 'slide-photo.html',
})
export class SlidePhotoPage {
  @ViewChild(Slides) slides: Slides;
  
  //大图预览图片地址
  photo: string;
  index = 0;

  constructor(
    public navCtrl: NavController,
    public navParams: NavParams
  ) {
    this.photo= navParams.get('photo');
    this.index= navParams.get('i');
    // console.log(this.photos,this.index);
  }

  ionViewDidLoad() {
    this.slides.zoom = true;
    this.slides.zoomMax = 3;
    this.slides.zoomMin = 1;
    // console.log('ionViewDidLoad SlidePhotoPage');
  }

  close(){
    this.navCtrl.pop();
  }

  // goToSlide() { //滑动方法，
  //   this.slides.slideTo(this.index, 1);
  // }

}
